// 求和功能相关的配置
export default {
    namespaced: true,
    actions: {
        jiaOdd(context, value) {
            console.log('Action jiaOdd处理了一些事情');
            context.dispatch('demo1', value);
        },
        jiaWait(context, value) {
            setTimeout(() => {
                context.commit('JIA', value);
            }, 500);
        },
        demo1(context, value) {
            console.log('demo1处理了一些事情');
            if (0 !== context.state.sum % 2) {
                context.commit('JIA', value);
            }
        },
    },
    mutations: {
        JIA(state, value) {
            //console.log('mutations.jia',state,value);
            state.sum += value;
        },
        JIAN(state, value) {
            state.sum -= value;
        },
    },
    state: {
        sum: 0,
        school: '培立优',
        subject: 'JAVA',
    },
    getters: {
        bigSum(state) {
            return state.sum * 10;
        }
    }
};
